<%@page import="java.util.Random" contentType="text/html; charset=UTF-8"%>
<%@ page import="veiculo.*,fachada.*,modelo.*,cor.*,categoria.*;"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Cadastro de Veículo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
    <!--
    Created by Artisteer v2.5.0.29918
    Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional"
    -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    

    <link rel="stylesheet" href="layout/style.css" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->

    <script type="text/javascript" src="script.js"></script>
</head>
<body>
    <div id="art-page-background-gradient"></div>
    <div id="art-page-background-glare">
        <div id="art-page-background-glare-image"></div>
    </div>
    <div id="art-main">
        <div class="art-sheet">
            <div class="art-sheet-tl"></div>
            <div class="art-sheet-tr"></div>
            <div class="art-sheet-bl"></div>
            <div class="art-sheet-br"></div>
            <div class="art-sheet-tc"></div>
            <div class="art-sheet-bc"></div>
            <div class="art-sheet-cl"></div>
            <div class="art-sheet-cr"></div>
            <div class="art-sheet-cc"></div>
            <div class="art-sheet-body">
                <div class="art-nav">
                	<ul class="art-menu">
                		
                	</ul>
                </div>
                <div class="art-header">
                    <div class="art-header-jpeg"></div>
                    <script type="text/javascript" src="swfobject.js"></script>
                    <div id="art-flash-area">
                    <div id="art-flash-container">
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="900" height="225" id="art-flash-object">
                        <param name="movie" value="images/flash.swf" />
                        <param name="quality" value="high" />
                    	<param name="scale" value="exactfit" />
                    	<param name="wmode" value="transparent" />
                    	<param name="flashvars" value="color1=0xFFFFFF&amp;alpha1=.76&amp;framerate1=24&amp;loop=true" />
                        <param name="swfliveconnect" value="true" />
                        <!--[if !IE]>-->
                        <object type="application/x-shockwave-flash" data="layout/images/flash.swf" width="900" height="225">
                            <param name="quality" value="high" />
                    	    <param name="scale" value="exactfit" />
                    	    <param name="wmode" value="transparent" />
                    	    <param name="flashvars" value="color1=0xFFFFFF&amp;alpha1=.76&amp;framerate1=24&amp;loop=true" />
                            <param name="swfliveconnect" value="true" />
                        <!--<![endif]-->
                          	<div class="art-flash-alt"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></div>
                        <!--[if !IE]>-->
                        </object>
                        <!--<![endif]-->
                    </object>
                    </div>
                    </div>
                    <script type="text/javascript">swfobject.switchOffAutoHideShow();swfobject.registerObject("art-flash-object", "9.0.0", "expressInstall.swf");</script>
                   
                </div>
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content">
                            <div class="art-post">
                                <div class="art-post-tl"></div>
                                <div class="art-post-tr"></div>
                                <div class="art-post-bl"></div>
                                <div class="art-post-br"></div>
                                <div class="art-post-tc"></div>
                                <div class="art-post-bc"></div>
                                <div class="art-post-cl"></div>
                                <div class="art-post-cr"></div>
                                <div class="art-post-cc"></div>
                                <div class="art-post-body">
                            <div class="art-post-inner art-article">
          

<%
  Fachada fx = new Fachada(); 




/*
if(request.getParameter("Submit") != null){
		

		try { 
			   
			   String placa = request.getParameter("placa").trim();
			   String ano = request.getParameter("ano").trim();
			   String chassi = request.getParameter("chassi").trim();
			   String cor = request.getParameter("lista_cor").trim();
			   String modelo = request.getParameter("lista_modelo").trim();
			   String categoria = request.getParameter("lista_categoria").trim();
			   String acessorio = request.getParameter("acessorio").trim();
			   double tarifa = Double.parseDouble(request.getParameter("tarifa").trim());
			   String foto = request.getParameter("foto").trim();
			   String video = request.getParameter("video").trim();
			  
			   Veiculo vei = new Veiculo();
			   vei.setPlaca(placa);
			   vei.setAno(Integer.parseInt(ano));
			   vei.setChassi(chassi);
			   vei.setCor(Integer.parseInt(cor));
			   vei.setModelo(Integer.parseInt(modelo));
			   vei.setCategoria(Integer.parseInt(categoria));
			   vei.setTarifa(tarifa);
			   vei.setAcessorio(acessorio);
// 			   vei.setFoto(foto);
// 			   vei.setVideo(video);
			   			   
			   fx.inserirVeiculo(vei);
			   response.sendRedirect("mensagem.jsp?texto=Cadastro efetuado com sucesso!&pag=TelaCadastroVeiculo.jsp");
			   
		  }catch(Exception e){ 
		
			  response.sendRedirect("mensagem.jsp?texto="+ e.getMessage()+"&pag=TelaCadastroVeiculo.jsp");
		   
		  }

	}
*/
%>

	<center>
		<h1>Loc AutoWeb - Cadastrar Veículo</h1>
	</center>
	<br /> 					
	<form name="form1" method="post" enctype="multipart/form-data" action="addfoto">
		<table>
			<tbody>
				<tr>
					<td><label>Placa:</label></td>
					<td><input type="text" name="placa" size="10" maxlength="7"></td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Ano:</label></td>
					<td><input type="text" name="ano" size="5" maxlength="4"></td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Chassi:</label></td>
					<td><input type="text" name="chassi" size="20"></td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Cor:</label></td>
					<td>
						<select name="lista_cor" id="lista_cor">
						<option selected>...</option>
						<%
							Cor[] c = null;
				
							c = fx.listarCor();
							
							for (int i = 0; i < c.length; i++)				
							{
						%>
						 <option value="<%=c[i].getCodigo()%>"><%=c[i].getDescricao()%></option>
						<%
							}
						%>
				
					</select>
					</td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Modelo:</label></td>
					<td>
					
					<select name="lista_modelo" id="lista_modelo">
						<option selected>...</option>
						<%
							Modelo[] mod = null;
				
							mod = fx.listarModelo();
				
							for (int i = 0; i < mod.length; i++)				
							{
						%>
						 <option value="<%=mod[i].getCodigo()%>"><%=mod[i].getDescricao()%></option>
						<%
							}
						%>
				
					</select>
					
					</td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Categoria:</label></td>
					<td>
						<select name="lista_categoria" id="lista_categoria">
							<option selected>...</option>
							<%
								Categoria[] cat = null;
					
								cat = fx.listarCategoria();
					
								for (int i = 0; i < cat.length; i++)				
								{
							%>
							 <option value="<%=cat[i].getCodigo()%>"><%=cat[i].getDescricao()%></option>
							<%
								}
							%>
						</select>
					</td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Foto:</label></td>
					<td><input type="file" name="foto" id="foto"></td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Vídeo:</label></td>
					<td><input type="file" name="video" id="video"></td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Tarifa:</label></td>
					<td><input type="text" name="tarifa">&nbsp;(informe apenas número EX: 3 ou 3.5 ou 30.5)</td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td><label>Descrição - Acessório</label></td>
					<td><textarea cols="50" rows="10" name="acessorio"></textarea></td>
				</tr>
				<tr>&nbsp;</tr>
				<tr>
					<td colspan="1"><input type="submit" name="Submit" value="Cadastrar"></td>
				</tr>
			</tbody>
		</table>
	</form>
	             
                                            <div class="cleared"></div>
                            </div>
                            
                            		<div class="cleared"></div>
                                </div>
                            </div>
                           
                        </div>
                    </div>
                </div>
                <div class="cleared"></div><div class="art-footer">
                    <div class="art-footer-t"></div>
                    <div class="art-footer-l"></div>
                    <div class="art-footer-b"></div>
                    <div class="art-footer-r"></div>
                    <div class="art-footer-body">
                         <a href="#" class="art-rss-tag-icon" title="RSS"></a>
                        <div class="art-footer-text">
                            <p>Copyright &copy; 2012 --- É proibida a reprodu&ccedil;&atilde;o total ou parcial do conte&uacute;do deste site para fins comerciais. 
 Tecnologia, Arte e Desenvolvimento: Anderson Elias, Alexsandro Marques, Marcello Pedrosa e Rosiberto Santos.</p>
                        </div>
                		<div class="cleared"></div>
                    </div>
                </div>
        		<div class="cleared"></div>
            </div>
        </div>
        <div class="cleared"></div>
        <p class="art-page-footer"><a href="http://www.facebook.com/locautoweb">Loc AutoWeb</a> created with Artisteer.</p>
    </div>
    
</body>
</html>
	

